package com.lancoo.znbkxx.base;

import android.app.Application;

import com.lancoo.znbkxx.beans.RequestLogBean;
import com.hw.applogger.MsgLogger;
import com.hw.applogger.RequestLogger;

/**
 * Create by TangJun on 2019/2/16
 */
public class BaseLibInitialization extends IApplicationStateCall {
    @Override
    public void onCreateInit(Application application) {
        MsgLogger.init(AppConstant.Dir + "5334msg");
        RequestLogger.init(AppConstant.Dir + "5335req");
        NetLogger.addLogListener(new INetLogListener() {
            @Override
            public void onRequestLog(RequestLogBean logBean) {
                com.hw.applogger.RequestLogBean l = new com.hw.applogger.RequestLogBean();
                l.IsSuccess = logBean.IsSuccess;
                l.Params = logBean.Params;
                l.Response = logBean.Response;
                l.ResponseCode = logBean.ResponseCode;
                l.Tag = logBean.Tag;
                l.Time = logBean.Time;
                l.Url = logBean.Url;
                RequestLogger.log(l);
            }

            @Override
            public void onResponseLog(byte[] bytes) {

            }
        });
    }

    @Override
    public void onLowMemory(Application application) {

    }
}

